## Controller Python Script "products_list"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=Send feedback to portal administrator
##

dir_products = 'prodotti'
types_to_filter = 'Folder'

from Products.CMFCore.utils import getToolByName

portal_catalog = getToolByName(context, 'portal_catalog')
dir = getattr(context, dir_products, None)

query = {}
query["path"] = dict(query='/'.join(dir.getPhysicalPath()), depth=1)
query["Type"] = types_to_filter
query["review_state"] = 'published'

# Return brain objects for search results
brains = portal_catalog.searchResults(**query)

return brains